/**
 *
 * @author jose
 */
public class InsertionSort {
  public static Comparable[] insertion_srt(Comparable[] arreglo){
    for (int i = 1; i < arreglo.length ; i++){
        int j = i;
        Comparable B = arreglo[i];
        
        while ((j > 0) && (arreglo[j-1].compareTo(B)>0)){
            arreglo[j] = arreglo[j-1];
            j--;
        }
        arreglo[j] = B;
    }
    return arreglo;
  }
 
}